package com.bocai.kelalacar;

import android.app.Application;
import android.content.Context;

import com.tencent.bugly.crashreport.CrashReport;
import com.zhy.autolayout.config.AutoLayoutConifg;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by yuanfei on 2017/6/5.
 */

public class App extends Application {
    private AppComponent appComponent;

    private static Application baseApplication;

    public static String JpushId;

    public static App get(Context context){
        return (App)context.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        CrashReport.initCrashReport(getApplicationContext(), "c6287478fb", true);
        AutoLayoutConifg.getInstance().useDeviceSize();
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
        baseApplication = this;
        JpushId = JPushInterface.getRegistrationID(this);
        appComponent=DaggerAppComponent.builder()
                .appModule(new AppModule(this))
                .build();
    }

    public static Context getAppContext() {
        return baseApplication;
    }

    public AppComponent getAppComponent() {
        return appComponent;
    }
}
